/*
* Copyright 2023 NXP
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"

char g_wifi_id[20] = {0};
char g_wifi_ip[20] = {0};
void setup_scr_WIFI(lv_ui *ui)
{
	//Write codes WIFI
	ui->WIFI = lv_obj_create(NULL);
	lv_obj_set_size(ui->WIFI, 130, 162);
	lv_obj_set_scrollbar_mode(ui->WIFI, LV_SCROLLBAR_MODE_OFF);

	//Write style for WIFI, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->WIFI, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_color(ui->WIFI, lv_color_hex(0x00bdff), LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes WIFI_btn_1
	ui->WIFI_btn_1 = lv_btn_create(ui->WIFI);
	ui->WIFI_btn_1_label = lv_label_create(ui->WIFI_btn_1);
	lv_label_set_text(ui->WIFI_btn_1_label, "Back");
	lv_label_set_long_mode(ui->WIFI_btn_1_label, LV_LABEL_LONG_WRAP);
	lv_obj_align(ui->WIFI_btn_1_label, LV_ALIGN_CENTER, 0, 0);
	lv_obj_set_style_pad_all(ui->WIFI_btn_1, 0, LV_STATE_DEFAULT);
	lv_obj_set_pos(ui->WIFI_btn_1, 3, 141);
	lv_obj_set_size(ui->WIFI_btn_1, 65, 14);
	lv_obj_set_scrollbar_mode(ui->WIFI_btn_1, LV_SCROLLBAR_MODE_OFF);

	//Write style for WIFI_btn_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->WIFI_btn_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_border_width(ui->WIFI_btn_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->WIFI_btn_1, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->WIFI_btn_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->WIFI_btn_1, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->WIFI_btn_1, &lv_font_montserratMedium_10, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->WIFI_btn_1, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes WIFI_label_1
	ui->WIFI_label_1 = lv_label_create(ui->WIFI);
	lv_label_set_text(ui->WIFI_label_1, "WIFI");
	lv_label_set_long_mode(ui->WIFI_label_1, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->WIFI_label_1, 14, 5);
	lv_obj_set_size(ui->WIFI_label_1, 101, 32);
	lv_obj_set_scrollbar_mode(ui->WIFI_label_1, LV_SCROLLBAR_MODE_OFF);

	//Write style for WIFI_label_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->WIFI_label_1, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->WIFI_label_1, &lv_font_Alatsi_Regular_20, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->WIFI_label_1, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->WIFI_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes WIFI_label_2
	ui->WIFI_label_2 = lv_label_create(ui->WIFI);
	lv_label_set_text(ui->WIFI_label_2, "ID:");
	lv_label_set_long_mode(ui->WIFI_label_2, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->WIFI_label_2, 3, 47);
	lv_obj_set_size(ui->WIFI_label_2, 31, 15);
	lv_obj_set_scrollbar_mode(ui->WIFI_label_2, LV_SCROLLBAR_MODE_OFF);

	//Write style for WIFI_label_2, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->WIFI_label_2, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->WIFI_label_2, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->WIFI_label_2, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->WIFI_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes WIFI_label_3
	ui->WIFI_label_3 = lv_label_create(ui->WIFI);
	lv_label_set_text(ui->WIFI_label_3, "IP:");
	lv_label_set_long_mode(ui->WIFI_label_3, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->WIFI_label_3, 3, 73);
	lv_obj_set_size(ui->WIFI_label_3, 31, 15);
	lv_obj_set_scrollbar_mode(ui->WIFI_label_3, LV_SCROLLBAR_MODE_OFF);

	//Write style for WIFI_label_3, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->WIFI_label_3, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->WIFI_label_3, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->WIFI_label_3, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->WIFI_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes WIFI_id
	ui->WIFI_id = lv_label_create(ui->WIFI);
	lv_label_set_text(ui->WIFI_id, g_wifi_id);
	lv_label_set_long_mode(ui->WIFI_id, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->WIFI_id, 34, 47);
	lv_obj_set_size(ui->WIFI_id, 92, 15);
	lv_obj_set_scrollbar_mode(ui->WIFI_id, LV_SCROLLBAR_MODE_OFF);

	//Write style for WIFI_id, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->WIFI_id, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->WIFI_id, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->WIFI_id, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->WIFI_id, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes WIFI_ip
	ui->WIFI_ip = lv_label_create(ui->WIFI);
	lv_label_set_text(ui->WIFI_ip, g_wifi_ip);
	lv_label_set_long_mode(ui->WIFI_ip, LV_LABEL_LONG_WRAP);
	lv_obj_set_pos(ui->WIFI_ip, 34, 73);
	lv_obj_set_size(ui->WIFI_ip, 92, 15);
	lv_obj_set_scrollbar_mode(ui->WIFI_ip, LV_SCROLLBAR_MODE_OFF);

	//Write style for WIFI_ip, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_border_width(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->WIFI_ip, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->WIFI_ip, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_letter_space(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_line_space(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->WIFI_ip, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_bg_opa(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_top(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_right(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_bottom(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_pad_left(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->WIFI_ip, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Update current screen layout.
	lv_obj_update_layout(ui->WIFI);

	
	//Init events for screen.
	events_init_WIFI(ui);
}
